package cn.edu.ujn.service;

import cn.edu.ujn.dao.Login;
import cn.edu.ujn.dao.PaymentInfo;
import cn.edu.ujn.dao.PaymentInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PaymentInfoServiceImpl implements IPaymentInfoService {

    @Autowired
    private PaymentInfoMapper paymentInfoMapper;

    @Override
    public int addPayment(PaymentInfo payment) {
        return paymentInfoMapper.insertPayment(payment);
    }

    @Override
    public int updatePayment(PaymentInfo payment) {
        return paymentInfoMapper.updatePayment(payment);
    }

    @Override
    public int deletePayment(int paymentId) {
        return paymentInfoMapper.deletePayment(paymentId);
    }

    @Override
    public PaymentInfo getPaymentById(int paymentId) {
        return paymentInfoMapper.selectPaymentById(paymentId);
    }

    @Override
    public List<PaymentInfo> getAllPayments() {
        return paymentInfoMapper.selectAllPayments();
    }
}
